<template>
	<view>
		<view class="u-flex u-row-between title_top u-border-bottom">
			<view>仓库年总计</view>
			<view>
				<text>总库存：{{static.num}}件</text>
				<text style="margin-left:20rpx;">总金额：￥{{static.price}}</text>
			</view>
		</view>
		<view>
			<view class="u-flex u-row-between title_top" style="background-color: #fff;margin-bottom:10rpx;">
				<view class="list_title">
					<text class="u-margin-right-15">仓库</text>
					<u-icon name="arrow-down" color="#555" size="32"></u-icon>
				</view>
				<view>
					<text>库存：{{static.num}}件</text>
					<text style="margin-left:20rpx;">金额：￥{{static.price}}</text>
				</view>
			</view>
			<!--  v-if="item.isopen" -->
			<view class="u-padding-15 u-border-bottom" style="background-color: #fff;" v-for="(item,index) in list" :key="index">
				<view class="u-flex u-row-between list_con">
					<text>{{item.nav.nav}}</text>
					<text>￥{{item.static.price}}</text>
				</view>
				<view class="u-flex u-row-between list_con" style="font-size: 28rpx;color:#666;">
					<text>统计时间：{{$u.timeFormat(item.nav.update_time, 'yyyy-mm-dd')}}</text>
					<text>× {{item.static.num}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		storehouseStatic
	} from "@/service/assetService.js";
	export default {
		data () {
			return{
				static:{},
				list:[]
			}
		},
		onLoad() {
			storehouseStatic().then(this.storehouseStatic);
		},
		methods:{
			storehouseStatic(e){
				if(e.code==200){
					this.static=e.result.static;
					this.list=e.result.list
				}
			},
			toopen(open,index){
				this.list[index].isopen=!open;
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f5f5f5;
	}
	.title_top{
		margin-top:20rpx;
		margin-bottom: 3rpx;
		padding: 20rpx;
		background-color: #fff;
	}
	.list_con{
		padding:20rpx 0;
	}
	.list_title{
		background-color: #eee;
		border-radius: 10rpx;
		padding:20rpx;
	}
</style>